<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The RecursiveDirectoryIterator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="recursivecallbackfilteriterator.haschildren.html">RecursiveCallbackFilterIterator::hasChildren</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="recursivedirectoryiterator.construct.html">RecursiveDirectoryIterator::__construct</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.recursivedirectoryiterator" class="reference">
 <h1 class="title">The RecursiveDirectoryIterator class</h1>
 
 
 <div class="partintro"><p class="verinfo">(PHP 5)</p>
 

  <div class="section" id="recursivedirectoryiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    The <strong class="classname">RecursiveDirectoryIterator</strong> provides
    an interface for iterating recursively over filesystem directories.
   </p>
  </div>

 
  <div class="section" id="recursivedirectoryiterator.synopsis">
   <h2 class="title">类摘要</h2>
 

   <div class="classsynopsis">
    <div class="ooclass"></div>
 

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">RecursiveDirectoryIterator</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.filesystemiterator.html" class="classname">FilesystemIterator</a>
     </span>

     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.seekableiterator.html" class="interfacename">SeekableIterator</a></span>
     </span>

     <span class="oointerface">, 
      <span class="interfacename"><a href="class.recursiveiterator.html" class="interfacename">RecursiveIterator</a></span>
     </span>

     {</div>

 
    
 
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="recursivedirectoryiterator.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="recursivedirectoryiterator.getchildren.html" class="methodname">getChildren</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="recursivedirectoryiterator.getsubpath.html" class="methodname">getSubPath</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="recursivedirectoryiterator.getsubpathname.html" class="methodname">getSubPathname</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="recursivedirectoryiterator.haschildren.html" class="methodname">hasChildren</a></span>
    ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$allow_links</code><span class="initializer"> = false</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="recursivedirectoryiterator.key.html" class="methodname">key</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="recursivedirectoryiterator.next.html" class="methodname">next</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="recursivedirectoryiterator.rewind.html" class="methodname">rewind</a></span>
    ( <span class="methodparam">void</span>
   )</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherits */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="filesystemiterator.construct.html" class="methodname">FilesystemIterator::__construct</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$path</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="filesystemiterator.current.html" class="methodname">FilesystemIterator::current</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="filesystemiterator.getflags.html" class="methodname">FilesystemIterator::getFlags</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="filesystemiterator.key.html" class="methodname">FilesystemIterator::key</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="filesystemiterator.next.html" class="methodname">FilesystemIterator::next</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="filesystemiterator.rewind.html" class="methodname">FilesystemIterator::rewind</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="filesystemiterator.setflags.html" class="methodname">FilesystemIterator::setFlags</a></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
  ] )</div>

   }</div>
 
  </div>
 


  <div class="section">
   <h2 class="title">更新日志</h2>
   <p class="para">
    <table class="doctable informaltable">
     
      <thead>
       <tr>
        <th>版本</th>
        <th>说明</th>
       </tr>

      </thead>

      <tbody class="tbody">
       <tr>
        <td>5.3.0</td>
        <td>
         The <a href="class.filesystemiterator.html" class="classname">FilesystemIterator</a> was introduced as 
         the parent class. Previously, the parent was the 
         <a href="class.directoryiterator.html" class="classname">DirectoryIterator</a>.
        </td>
       </tr>

       <tr>
        <td>5.3.0</td>
        <td>
         Implements <span class="interfacename"><a href="class.seekableiterator.html" class="interfacename">SeekableIterator</a></span>.
        </td>
       </tr>

       <tr>
        <td>5.2.11, 5.3.1</td>
        <td>Added <strong><code>RecursiveDirectoryIterator::FOLLOW_SYMLINKS</code></strong></td>
       </tr>

      </tbody>
     
    </table>

   </p>
  </div>
  
 </div>
 
 



















































 
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="recursivedirectoryiterator.construct.html">RecursiveDirectoryIterator::__construct</a> — Constructs a RecursiveDirectoryIterator</li><li><a href="recursivedirectoryiterator.getchildren.html">RecursiveDirectoryIterator::getChildren</a> — Returns an iterator for the current entry if it is a directory</li><li><a href="recursivedirectoryiterator.getsubpath.html">RecursiveDirectoryIterator::getSubPath</a> — Get sub path</li><li><a href="recursivedirectoryiterator.getsubpathname.html">RecursiveDirectoryIterator::getSubPathname</a> — Get sub path and name</li><li><a href="recursivedirectoryiterator.haschildren.html">RecursiveDirectoryIterator::hasChildren</a> — Returns whether current entry is a directory and not '.' or '..'</li><li><a href="recursivedirectoryiterator.key.html">RecursiveDirectoryIterator::key</a> — Return path and filename of current dir entry</li><li><a href="recursivedirectoryiterator.next.html">RecursiveDirectoryIterator::next</a> — Move to next entry</li><li><a href="recursivedirectoryiterator.rewind.html">RecursiveDirectoryIterator::rewind</a> — Rewind dir back to the start</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="recursivecallbackfilteriterator.haschildren.html">RecursiveCallbackFilterIterator::hasChildren</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="recursivedirectoryiterator.construct.html">RecursiveDirectoryIterator::__construct</a></div>
 <div class="up"><a href="spl.iterators.html">迭代器</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
